/**
 * Created by meiguizhinian on 2018/7/9
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

//TODO：等待完成
//cocos2dx class
unblockme.PauseDialog = LLDialog.extend({
	ctor: function (form) {
		this._super(form);

		let button_back = this._formNode.getChildByName("bt3");
		button_back.setTouchEndCallback(function() {
			ivy.Tools.pushFunctionToCocosThread(function() {
				this.close();
			}.bind(this));
		}.bind(this));
		let button_menu = this._formNode.getChildByName("bt1");
		button_menu.setTouchEndCallback(function() {
			this.close();
			cc.LoaderScene.preload(unblockme.GateScene.prototype.res, function () {
				let scene = unblockme.GateScene.create("Gate");
				cc.director.runScene(scene);
			}, this);
		}.bind(this));
		LLNodeHelper.registerAudioButton(this._formNode, "bt2");
	},

	onEnter : function() {
		this._super();
		//Advertise::countPlayTime(false);
		//IvySDK::closeBanner();
	},
	onExit : function() {
		// Advertise::countPlayTime(true);
		// if (IvySDK::hasBanner("default")) {
		// 	IvySDK::showBanner("default", IvySDK::AD_POS_MIDDLE_BOTTOM);
		// }
		this._super();
	},
});

unblockme.PauseDialog.create = function (form) {
	return new unblockme.PauseDialog(form);
};
